#ifndef EDITORWIDGET_H
#define EDITORWIDGET_H

#include <QTextEdit>

class EditorWidget : public QTextEdit
{
    Q_OBJECT
public:
    explicit EditorWidget(QWidget *parent = 0);
    virtual ~EditorWidget();

    void setFontScale(qreal factor);

protected:
    // copy+paste
    virtual QMimeData* createMimeDataFromSelection() const;
    virtual bool canInsertFromMimeData(const QMimeData *source) const;
    virtual void insertFromMimeData(const QMimeData *source);

    // reimplement to disable drag and drop
    virtual void dragEnterEvent(QDragEnterEvent *e);
    virtual void dragLeaveEvent(QDragLeaveEvent *e);
    virtual void dragMoveEvent(QDragMoveEvent *e);
    virtual void dropEvent(QDropEvent *e);

    void mouseMoveEvent(QMouseEvent *e);

private:
    bool m_inMouseMove;
    qreal m_fontPointSize;
};

#endif // EDITOR_H
